[#escape x as x?html]
<!DOCTYPE html>
<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
    <title>理赔服务编辑</title>
[#include "/include/jsvalidation.ftl"]
[#include "/include/main.ftl"]
[#include "/include/popdialog.ftl"]
    <script>
        $(function() {
            $("#ClaimsEdit").tabs();
        });
		function selectUser() {
            popDialog("selectUser", "选择客户",
                    "/Ins/customer/select",
                    rp, 600, 600);
        }
		
		var rp = function refreshPage(data) {
            if (data != null) {
                $('#custSn').val(data.sn);
                $('#name').html(data.name);
                $('#custType').val(data.custType);
                $('#custTypeName').html(data.custTypeName);
                $('#IDCard').html(data.IDCard);
                $('#IDAddress').html(data.IDAddress);
                $('#compAddress').html(data.compAddress);
                $('#custLink').attr("href", "/Ins/customer/edit/" + data.sn);
				initCustomerCars(data.sn);
            }
        };
		
		function initCustomerCars(sn) {
		    $.get('/Ins/Customer/getCars/' + sn, null,
            function(data){
                var tbodyCar = "";
                $.each(data, function(i, val){
                    tbodyCar += "<tr>"+
                                "<td><input type=\"radio\" name=\"custCarSn\" id=\"custCarSn_" + val.sn +"\" value=\"" + val.sn +"\">"+
                                    val.carNo + "</td>"+
                                "<td>"+ val.carKind +"</td>"+
                                "<td>"+ val.brand +"</td>"+
                                "<td>"+val.regDate+"</td>"+
                            "</tr>" ;
                });
                $('#cars').html(tbodyCar);
            },"json")
		}
    </script>
    
    
</head>
<body>
<div class="ui-widget page">
[#include '/top.ftl']

    <div class="content">
    [#include '/leftNav.ftl']
        <div style="width:845px;height:600px;float: left;padding-left: 5px">
            <div class="ui-widget-content ui-corner-all" style="min-height: 600px;">
                <form name="mainForm" id="mainForm" method="post" action="/Ins/claims/save">
<INPUT TYPE="hidden" NAME="sn" VALUE="${obj.ClaimsObj.sn?default('')}">
                <INPUT TYPE="hidden" NAME="custSn" id="custSn" VALUE="${obj.ClaimsObj.custSn?default('')}">
                 <INPUT TYPE="hidden" NAME="createUser" VALUE="${obj.ClaimsObj.createUser?default('')}">
                  <INPUT TYPE="hidden" NAME="createTime" VALUE="${(obj.ClaimsObj.createTime?string('yyyy-MM-dd'))?default('')}">
                    【<a href="/Ins/claims/list">返回理赔服务列表</a>】
                    <div id="ClaimsEdit" style="width:830px">

                        <ul style="border-bottom:#aed0ea 1px solid;">
                            <li><a href="Claims_base">理赔资料</a></li>

                        </ul>
                        <div id="Claims_base">
</p>
                        <p>【<a href="javaScript:selectUser();">选择客户</a>】
                        </p>
                      <p>【被保险人资料】</p>
                        <table width="100%" border="0" cellspacing="4">
                            <tr>
                                <td width="17%" bgcolor="#CCCCCC"><p>客户名称 </p></td>
                              <td><span id="name">${(obj.CustomerObj.name)!''}</span></td>
                            </tr>
                            <tr>
                                <td bgcolor="#CCCCCC"><p>身份证号 </p></td>
                              <td> <span id="IDCard">${(obj.CustomerObj.IDCard)!''}</span> </td>
                            </tr>
                            <tr class="trBackWhite">
                                <td bgcolor="#CCCCCC"><p>身份证地址 </p></td>
                              <td><span id="IDAddress">${(obj.CustomerObj.IDAddress)!''}</span></td>
                            </tr>
                            <tr class="trBackWhite">
                                <td bgcolor="#CCCCCC">单位地址</td>
                              <td> <span id="compAddress">${(obj.CustomerObj.compAddress)!''}</span></td>
                            </tr>
                        </table>
                        <table width="100%" border="0" cellspacing="4" cellpadding="0">
                            <tr>
                                <td colspan="4" bgcolor="#CCCCCC">投保车辆</td>
                            </tr>
                            <tr>
                                <td width="21%">车牌号</td>
                                <td width="18%">车型</td>
                                <td width="44%">品牌型号</td>
                                <td width="17%">注册日期</td>
                            </tr>
                            <tbody id="cars">
                            [#list obj.CustomerCars?default([]) as car]
                            <tr>
                                <td><input type="radio" name="custCarSn" id="custCarSn_${car.sn}" value="${car.sn}">
                                    ${car.carNo!""}
                                </td>
                                <td> ${car.carKind!""}</td>
                                <td>${car.brand!""}</td>
                                <td>${(car.regDate?string('yyyy-MM-dd'))?default('')}</td>
                            </tr>
                            [/#list]
                            </tbody>
                            <script>$("#custCarSn_${(obj.ClaimsObj.custCarSn)!''}").attr("checked",'true');</script>
                        </table>

<script>$("#custSn").val("${(obj.ClaimsObj.custSn)?default('')}");</script>
<p>
  立案号  <input type="text"  size="20" id="paNo" name="paNo" class="max-length-100 ">

<script>$("#paNo").val("${(obj.ClaimsObj.paNo)?default('')}");</script>
 </p>
<p>
交强保单号  <input type="text"  size="20" id="enPolicyNo" name="enPolicyNo" class="max-length-100 ">

<script>$("#enPolicyNo").val("${(obj.ClaimsObj.enPolicyNo)?default('')}");</script></p>
<p>
  商业保单号  <input type="text"  size="20" id="buPolicyNo" name="buPolicyNo" class="max-length-100 ">

<script>$("#buPolicyNo").val("${(obj.ClaimsObj.buPolicyNo)?default('')}");</script></p>
<p>
  出险时间  <input type="text"  size="20" id="accDate" name="accDate" class="validate-date-yyyy-MM-dd" onClick="popCalendar(this)" >

<script>$("#accDate").val("${(obj.ClaimsObj.accDate?string('yyyy-MM-dd'))?default('')}");</script>
 </p>
<p>
报案人  <input type="text"  size="20" id="reportPerson" name="reportPerson" class="max-length-100 ">

<script>$("#reportPerson").val("${(obj.ClaimsObj.reportPerson)?default('')}");</script>
 </p>
<p>
报案电话  <input type="text"  size="20" id="reportTel" name="reportTel" class="max-length-100 ">

<script>$("#reportTel").val("${(obj.ClaimsObj.reportTel)?default('')}");</script>
 </p>
<p>
出险经过 
<textarea id="accDetail" name="accDetail" cols="70" rows="5" class="max-length-1000 ">${(obj.ClaimsObj.accDetail)?default('')}</textarea>
 </p>
<p>
修车地点  <input type="text"  size="40" id="repairPlace" name="repairPlace" class="max-length-100 ">

<script>$("#repairPlace").val("${(obj.ClaimsObj.repairPlace)?default('')}");</script>
 </p>
<p>
理赔金额  <input type="text"  size="20" id="fee" name="fee" class="validate-float ">

<script>$("#fee").val("${(obj.ClaimsObj.fee)?default('')}");</script>
 </p>
<p>
赔案状态  <input type="text"  size="20" id="state" name="state" class="max-length-100 ">

<script>$("#state").val("${(obj.ClaimsObj.state)?default('')}");</script>
 </p>
<p>
责任归属  <input type="text"  size="20" id="duty" name="duty" class="max-length-100 ">

<script>$("#duty").val("${(obj.ClaimsObj.duty)?default('')}");</script>
 </p>
<p>
备注  
<textarea id="memo" name="memo" cols="70" rows="5" class="max-length-1000 ">${(obj.ClaimsObj.memo)?default('')}</textarea>
</p>
<p>
<span id="spClaims"></span> 
                                    <script>
                                    [#list obj.ClaimsFileList?default([]) as cid]
									$('#spClaims').html($('#spClaims').html()+getFileLink('${cid.sn}'));
                                [/#list]
								</script>
                                【<a href="javaScript:uploadFile('spClaims','理赔','${obj.ClaimsObj.sn?default('')}','原件');">上传附件</a>】
 </p>
<p>
                          <input name="submit" type="submit" value="保存" onClick="">
                        | <a href="/Ins/claims/del/${obj.ClaimsObj.sn?default('')}" onClick="return confirm('确定删除?')">删除</a></p>

                        </div>

                </form>
                <script>
                  va = new Validation('mainForm');
                </script>
            </div>

        </div>
    </div>

[#include '/bottom.ftl']
</div>
</body>
</html>
[/#escape]
